package com.main.tripplanner.servlet;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.http.MediaType;

import com.main.tripplanner.clientservices.CountryClientService;
import com.main.tripplanner.persistent.Ticket;

public class CountryServlet extends BaseServlet{
	private CountryClientService service;
	
	@Override
	protected void initialize() {
		try {
			service = getService(CountryClientService.class);
			if (service == null)
				service = CountryClientService.getService();
		} catch (Exception e) {
//			BaseService.log(this, "Initialization failed.", e);
		}
	}

	@Override
	protected void get(HttpServletRequest request, HttpServletResponse response, Ticket ticket) throws IOException {
		String serviceResponse = service.getResponse();
		ticket.setResponse(serviceResponse);
		putBody(response, ticket, MediaType.APPLICATION_JSON_VALUE);
	}

	@Override
	protected void post(HttpServletRequest request,
			HttpServletResponse response, Ticket ticket) throws IOException {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected void delete(HttpServletRequest request,
			HttpServletResponse response, Ticket ticket) throws IOException {
		// TODO Auto-generated method stub
		
	}

	@Override
	protected void put(HttpServletRequest request,
			HttpServletResponse response, Ticket ticket) throws IOException {
		// TODO Auto-generated method stub
		
	}

}
